import requests

cookies = {
    'qcc_did': '043f26a4-6fb4-4968-ae84-ef0ca6779d79',
    'UM_distinctid': '196ec5fd5a09e7-0ce8ec88feb166-26011f51-144000-196ec5fd5a11ab7',
    'QCCSESSID': 'f840915e1f433d622487aed4d8',
    'tfstk': 'gVRsibAlmlq6SH1YlO0UOrmwKH1jX2lPcr_vrEFak1CTDoLRYNRZjEIXcHSHct0G0iIX0EpZ8blySFfcMnirab8pb8VwflQAXqIdSa3FWWu01tfcM0oFCQpo-sx9SxQWWe3CuZPOknIYv6IhlSQvDGBLva_lMsKAD9CdoZQAWiQT92_cviCAMnLKRZSdDAdEAwD1XFgZLb1DESaDJMNYMB_ImgLsoS_e6N612Fd_MSHR5OsJWMitwHCfpEXXirVf3FpkmaKTXmsDOed9e3nUQGp5lUJX2qyG8tOGOidtZzsp1EOCIprTBa11fTdOejgWytpBO1Rtm8YeRGB5Tpknbt56fLjlBvmHceswDC6LfDS2UeROd3nUOnXXHC5p6Dh54FNPVHZghy6uGwsrR2w0ncGBwBFEok7FBwbea2gQf-quMSy6g2wYHOQh893IRlw5.',
    'acw_tc': '0a47308f17504066021598434e005cd24c0128f77a450b2e65585993b6e208',
    'CNZZDATA1254842228': '882588239-1747722426-%7C1750406890',
}

headers = {
    '278fcd3b10ae73561ab2': '8bd1c18e5e7bd58b837f1dc2b914f4a640d9c4960e4e715d6e6f3e71a3311dceb303c73edf7aa6a59c49ed041d31c1ffa6f4924dbc85b7fabcad11a3be57a3f5',
    'accept': 'application/json, text/plain, */*',
    'accept-language': 'zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6',
    'priority': 'u=1, i',
    'referer': 'https://www.qcc.com/web/project/batchList?batchType=1',
    'sec-ch-ua': '"Google Chrome";v="137", "Chromium";v="137", "Not/A)Brand";v="24"',
    'sec-ch-ua-mobile': '?0',
    'sec-ch-ua-platform': '"Windows"',
    'sec-fetch-dest': 'empty',
    'sec-fetch-mode': 'cors',
    'sec-fetch-site': 'same-origin',
    'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36',
    'x-pid': '16636605b06bd82951470064a8d17eae',
    'x-requested-with': 'XMLHttpRequest',
    # 'cookie': 'qcc_did=043f26a4-6fb4-4968-ae84-ef0ca6779d79; UM_distinctid=196ec5fd5a09e7-0ce8ec88feb166-26011f51-144000-196ec5fd5a11ab7; QCCSESSID=f840915e1f433d622487aed4d8; tfstk=gVRsibAlmlq6SH1YlO0UOrmwKH1jX2lPcr_vrEFak1CTDoLRYNRZjEIXcHSHct0G0iIX0EpZ8blySFfcMnirab8pb8VwflQAXqIdSa3FWWu01tfcM0oFCQpo-sx9SxQWWe3CuZPOknIYv6IhlSQvDGBLva_lMsKAD9CdoZQAWiQT92_cviCAMnLKRZSdDAdEAwD1XFgZLb1DESaDJMNYMB_ImgLsoS_e6N612Fd_MSHR5OsJWMitwHCfpEXXirVf3FpkmaKTXmsDOed9e3nUQGp5lUJX2qyG8tOGOidtZzsp1EOCIprTBa11fTdOejgWytpBO1Rtm8YeRGB5Tpknbt56fLjlBvmHceswDC6LfDS2UeROd3nUOnXXHC5p6Dh54FNPVHZghy6uGwsrR2w0ncGBwBFEok7FBwbea2gQf-quMSy6g2wYHOQh893IRlw5.; acw_tc=0a47308f17504066021598434e005cd24c0128f77a450b2e65585993b6e208; CNZZDATA1254842228=882588239-1747722426-%7C1750406890',
}

params = {
    'batchType': '0',
}

response = requests.get('https://www.qcc.com/api/batch/getBatchRedis', params=params, cookies=cookies, headers=headers)


data_url = response.json()
data_urllist = []
# for i in data_url['data']:
#     with open('./url_value17_code.txt', 'a+', encoding='utf-8') as f:
#         f.write(f'{i['KeyNo']}\n')
        # https://www.qcc.com/cassets/27505d1266d23b6d705c5979da848d75.html
for x in data_url['data']:
    with open('./url_value17_code.txt', 'a+', encoding='utf-8') as f:
        f.write(f'{x['Name']}\n')
